Skip to content

WIP: Host ip fix - #154

Closed
gel-bcegielka wants to merge 2 commits into
testcontainers:masterfrom
gel-bcegielka:host-ip-fix
Closed

gel-bcegielka wants to merge 2 commits into
testcontainers:masterfrom
gel-bcegielka:host-ip-fix

Conversation

@gel-bcegielka

Copy link
Copy Markdown

No description provided.

@gel-bcegielka gel-bcegielka changed the title Host ip fix WIP: Host ip fix Sep 8, 2021
@gel-bcegielka

gel-bcegielka commented Sep 8, 2021 •

Copy link
Copy Markdown
Author

Apologies, I was meant to create PR in my fork, but didn't change the base. This can be closed as it was a dirty hack to get testcontainers in gitlab dind setup.
It such case
https://github.com/testcontainers/testcontainers-python/blob/master/testcontainers/core/container.py#L79
function get_container_host_ip returns container’s bridge ip 178.18.0.1
Connection url: postgresql+psycopg2://test:test@172.18.0.1:32768/test
which does not work.

What we need it docker service ip we started with .gitlab-ci.yml:

  services:
    - docker:19.03.13-dind
  variables:
    DOCKER_HOST: tcp://docker:2376
    DOCKER_TLS_CERTDIR: "/certs"
    DOCKER_TLS_VERIFY: 1
    DOCKER_CERT_PATH: "$DOCKER_TLS_CERTDIR/client"

which is

$ ping -c 1 docker
PING docker (172.17.0.2): 56 data bytes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants